package com.punch.common.enums.course;

/**
 * @author xiaol
 * @date 2020/7/21 15:53
 * 班级状态枚举
 */

public enum ClassAuditEnum {
    TO_SIGN_UP(0, "待报名"),
    IN_SIGN_UP(1, "报名中"),
    BEGIN_CLASS(2, "已开班"),
    CANCEL_SIGN_UP(3, "取消报名"),
    FINISH_CLASS(4, "已完成"),
    CANCEL_CLASS(5,"开班延期"),
    SING_UP(6,"已报名")
    ;

    ClassAuditEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    private int code;
    private String name;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static String getName(Integer code) {
        if (code == null) {
            return "";
        }
        for (ClassAuditEnum roleEnum : ClassAuditEnum.values()) {
            if (roleEnum.getCode() == code) {
                return roleEnum.getName();
            }
        }
        return "";
    }
}

